package com.lebang.mapper.buss;

import com.lebang.entity.member.MemberInviteDetail;
import com.lebang.entity.member.MemberRebateDetail;
import com.lebang.model.vo.buss.MemberListVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author : tony
 * @Date: 2019-01-24 17:24
 * @Description:
 */
@Repository
public interface MemberInviteMapper {

    /**
     *  获取所有的返利记录
     * @param inviteId
     * @param startDate
     * @param memberId
     * @return
     */
    List<MemberRebateDetail> listMemberRebate(@Param("inviteId") String inviteId, @Param("startDate") Date startDate,@Param("memberId") String memberId);


    /**
     *  获取所有的邀请记录
     * @param inviteId
     * @param startDate
     * @return
     */
    List<MemberInviteDetail> listMemberInvite(@Param("inviteId") String inviteId, @Param("startDate") Date startDate);


    /**
     *
     * @param inviteId
     * @return
     */
    List<MemberListVo> listAllMemberVo(@Param("inviteId") String inviteId);

    /**
     * 获取所有返利的值
     * @param inviteId
     * @param startDate
     * @return
     */
    int getAllRebate(@Param("inviteId") String inviteId, @Param("startDate") Date startDate);

    /**
     * 获取期盼的总金额，不含比例
     * @param inviteId
     * @return
     */
    int getAllExpect(@Param("inviteId") String inviteId);

    /**
     *  根据邀请人的id，获取各个时间段内的推荐成功徒弟数量
     * @param inviteId
     * @param firstDate
     * @param secondDate
     * @param thirdDate
     * @return
     */
    Map<String,Long> getTimeCount(@Param("inviteId") String inviteId,@Param("startDate") Date startDate,@Param("firstDate") Date firstDate,@Param("secondDate") Date secondDate,@Param("thirdDate") Date thirdDate);


    /**
     *  获取邀新返利最高的列表数据
     * @param num
     * @return
     */
    List<Map<String,Object>> listTop(@Param("num") int num);


    Map<String ,Object> selfMoney(@Param("memberId")String memberId);

    int getMemberMoney(@Param("inviteId")String inviteId);

    int checkNotice(@Param("inviteId")String inviteId,@Param("memberId")String memberId,@Param("date") String date);
}
